class AccountChangeDefaults < ActiveRecord::Migration
  def self.up
    change_column :accounts, :balance, :decimal, :null => false, :default => 0
    change_column :accounts, :credit_limit, :decimal, :null => false, :default => 0
    change_column :accounts, :credit_summ, :decimal, :null => false, :default => 0
    change_column :accounts, :debet_summ, :decimal, :null => false, :default => 0
    change_column :accounts, :blocked_summ, :decimal, :null => false, :default => 0
  end

  def self.down
    change_column :accounts, :balance, :decimal, :null => true, :default => null
    change_column :accounts, :credit_limit, :decimal, :null => true, :default => null
    change_column :accounts, :credit_summ, :decimal, :null => true, :default => null
    change_column :accounts, :debet_summ, :decimal, :null => true, :default => null
    change_column :accounts, :blocked_summ, :decimal, :null => true, :default => null
  end
end
